package com.hfut.eeg.controller;

import org.springframework.security.web.savedrequest.HttpSessionRequestCache;
import org.springframework.security.web.savedrequest.RequestCache;
import org.springframework.security.web.savedrequest.SavedRequest;
import org.springframework.stereotype.Controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @author 梁琦
 * @program: eeg
 * @Package com.hfut.eeg.controller
 * @Description: TODO
 * @date 2019-11-12 15:59
 */
@Controller
public class BrowserSecurityController {

    private RequestCache requestCache = new HttpSessionRequestCache();
    /**
    * @Description: 需要身份认证时跳转
    * @param request
    * @param response
    * @return String
    * @author 梁琦
    * @date 2019-11-12 15:59
    * @throws IOException
    */
    public String requireAuthentication(HttpServletRequest request, HttpServletResponse response)
            throws IOException {

        SavedRequest savedRequest = requestCache.getRequest(request,response);

        return null;
    }

}
